package passing.score.system.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import passing.score.system.DAO.UserDAO;
import passing.score.system.Model.User;

import java.util.List;

@Service
public class UserService {

    UserDAO userDAO;

    @Autowired
    public void setUserDAO(UserDAO userDAO) {
        this.userDAO = userDAO;
    }

    public void register(User user){
        userDAO.register(user);
    }

    public void modifyPassword(User user){
        userDAO.modifyPassword(user);
    }

    public List<User> queryAll(){
        return userDAO.queryAll();
    }

    public User queryByUser(User user){
        return userDAO.queryByUser(user);
    }

    public void deleteUser(User user){
        userDAO.delete(user);
    }
}
